<?php 
class IndexController extends CommonController{
	public function index(){
//		分类导航
		$cate = M('hd_category')->where("pid=0")->all();
		foreach($cate as $k => $v){
			$cate[$k]['son']=M('hd_category')->where("pid=$v[cid]")->all();
		}
		$this->assign('cate', $cate);
//		待解决问题
		$notask = M('hd_ask')->where('solve=0')->order('time DESC')->limit(8)->all();
		$this->assign('notask', $notask);
//		高分悬赏问题
		$muchask = M('hd_ask')->where('solve=0 and reward>20')->order('reward DESC')->limit(8)->all();
		$this->assign('muchask', $muchask);
//		顶部导航传参
		$this->topCate();
		$this->rightCate();
		$this->display();
	}
}
?>